<form action="section.manage.php?action=footersave" id="form1" name="form1" method="post">
<table border="0" cellpadding="0" cellspacing="0" class="from_table2_one">
	<thead>
		<tr class="area_ajax_list_title">
		  <th class="pd-left" align="left" width="200">
		    <tpl> $langSysSecHomeDis </tpl>
		    </th>
		  <th align="left" width="200">
		    <tpl> $langSysSecName </tpl>
		    </th>
		  <th align="left" width="200">
		    <tpl> $langSysSecJumpLink </tpl>
		    </th>
		  <th align="left" width="200">
		    <tpl> $langCOperation </tpl>
		    </th>
		</tr>
	</thead>
	<tpl> if $section_array[0].section_id neq '' </tpl>
		<tpl> section name=i loop=$section_array </tpl>
		<tr>
			<td class="pd-left" width="200" align="left"><input 
		  
		  <tpl> if $section_array[i].is_show eq '1' </tpl>checked="checked"<tpl> /if </tpl> type="checkbox" name="section_id[]"  value="<tpl> $section_array[i].section_id </tpl>" /></td>
		  <td width="200" align="left"><tpl> $section_array[i].section_name </tpl></td>
			<td width="200" align="left"><tpl> if $section_array[i].section_url neq '' </tpl><a href="javascript:;" style="cursor:pointer;" title="<tpl> $section_array[i].section_url </tpl>"><tpl> $langCHave </tpl></a>
			<tpl> else </tpl>
				<tpl> $langCNot </tpl>
			<tpl> /if </tpl>
		  </td>
		  <td width="200" align="left"><a href="javascript:;" onclick="ShowDiv='result_content';getPageContent('section.manage.php?action=modi&id=<tpl> $section_array[i].section_id </tpl>');" title=" <tpl> $langCmodi </tpl>" class="modify_a_pic"></a><a href="javascript:;" onclick="section_del('<tpl> $section_array[i].section_id </tpl>');" title="<tpl> $langCdele </tpl>" class="del_a_pic"></a>		</tr>
		<tpl> /section </tpl>
		
	<tpl> else </tpl>
		<tr>
			<td colspan="4" align="center"><tpl> $langCNull </tpl></td>
		</tr>
	<tpl> /if </tpl>
</table>
<tpl> if $section_array[0].section_id neq '' </tpl>
<div class="table-5-bottom">
<div style="float:left; padding-left:20px">
			<span class="btn_left">
			<input name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langSysSecAllSelect </tpl>" /> 
			</span>
			<span class="btn_left">
			<input name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langSysSecContrarySelect </tpl>" />
			</span>
			<span class="btn_left">
			<input type="submit" value="<tpl> $langSysSecNewlyCreateShopFooter </tpl>" class="btn_submit"/>  
			</span>
			<span class="btn_left">
			<input type="button" id="section_html" name="section_html" value="<tpl> $langSysSecNewlyCreateBasicPage </tpl>" class="btn_submit"/>
			</span>
			</div>
			</div>
		<tpl> /if </tpl>
</form>
<div id="ui_question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langCConfirmDelete </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
		<input type="hidden" id="del_value" />
</div> 

<script language="javascript" type="text/javascript">
var ui_question = $("#ui_question")[0];
$(document).ready(function() {
	$('#negative').click(
		function(){
			$('#form1 input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
	);
	$('#selectall').click(
		function(){
			$('#form1 input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	
	$('#yes').click(function() {
		$.ajax({
			url: "section.manage.php",
			data: 'action=del&id='+$('#del_value').val(),
			type:'post',
			dataType:"json",
			beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
			success: function(msg){
				hideLoading();
				showMessage(msg.message,msg.type);
				if(msg.type == 1){
					ShowDiv = 'result_content';
					getPageContent('section.manage.php?action=ajax_list');
				}
				$.unblockUI(); 
			}
		});
		return false; 
	}); 
	$('#no').click($.unblockUI); 
	//操作
	var options = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
					},
		type:      'post',
		dataType:  'json'
	};
	$("#form1").validate({
		errorClass: "wrong",
		rules: {
			section_id: {requireChecked:true}
		},
		messages: {
			section_id: {required:"<tpl> $langSysSecPleaseSelectDisInfo </tpl>"}
		},
		submitHandler: function() {
			$('#form1').ajaxSubmit(options);
		}
	});	
	
	
	
	//生成基本栏目页
	$("#section_html").click(function(){
		$.ajax({
			url: "section.manage.php",
			data: 'action=section_html',
			type:'post',
			dataType:"json",
			beforeSubmit:  showLoading(showText),
			success: function(msg){
				hideLoading();
				showMessage(msg.message,msg.type);
			}
		});
		return false; 
	});
});
//删除
function section_del(str){
	hideMessage();
	$.blockUI(ui_question, { width: '275px' }); 
	$('#del_value').val(str);
}
</script>